﻿ /*
	Table: <Tablename, sysname, Bankkonto>
	Schema: <Schemaname, sysname, finance>
	Filegroup: <Partitionname, sysname, FG_FINANCE>
*/

CREATE TABLE [<Schemaname, sysname, finance>].[<Tablename, sysname, Bankkonto>]
(
	/* Primary Key */
	PK_<Tablename, sysname, Bankkonto> INT NOT NULL IDENTITY,
	
	/* Default Columns */
	CreatedAt DATETIME NOT NULL,
	CreatedBy NVARCHAR(256) NOT NULL,
	CreatedFromSource NVARCHAR(256) NOT NULL,
	ModifiedAt DATETIME,
	ModifiedBy NVARCHAR(256),
	ModifiedFromSource NVARCHAR(256)
) ON [<Partitionname, sysname, FG_FINANCE>]
GO

ALTER TABLE [<Schemaname, sysname, finance>].[<Tablename, sysname, Bankkonto>]
	ADD CONSTRAINT PK_<Tablename, sysname, Bankkonto>
		PRIMARY KEY(PK_<Tablename, sysname, Bankkonto>) ON <Indexpartitionname, sysname, FG_INDEXES>
GO

ALTER TABLE [<Schemaname, sysname, finance>].[<Tablename, sysname, Bankkonto>]
	ADD CONSTRAINT DEF_<Schemaname, sysname, finance>_<Tablename, sysname, Bankkonto>_CreatedAt
		DEFAULT GETDATE() FOR CreatedAt
GO